package com.rzjm.api.service.impl;

import com.rzjm.api.dao.GroupsDao;
import com.rzjm.api.dao.PianqusDao;
import com.rzjm.api.entity.Groups;
import com.rzjm.api.entity.Pianqus;
import com.rzjm.api.service.GroupsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class GroupsServiceImpl extends BaseServiceImpl<GroupsDao, Groups> implements GroupsService {

    @Resource
    private GroupsDao groupsDao;
    @Resource
    private PianqusDao pianqusDao;

    @Override
    public Groups getGroupByPianquId(Integer pianquId) {
        Pianqus pianqus = pianqusDao.selectById(pianquId);
        if(pianqus!= null){
            Groups groups = groupsDao.selectById(pianqus.getJituanId());
            return groups;
        }
        return null;
    }
}
